<?php require_once('Connections/sqlaerosnemanje.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Izberi red za izvoz</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?php
$izbrani_projekt = $_POST['id_projekta'];

mysql_select_db($database_sqlaerosnemanje, $sqlaerosnemanje);
$query_izberiRed = "SELECT * FROM xml_parameters WHERE IDProjekta = '$izbrani_projekt'";
$izberiRed = mysql_query($query_izberiRed, $sqlaerosnemanje) or die(mysql_error());
$row_izberiRed = mysql_fetch_assoc($izberiRed);
$totalRows_izberiRed = mysql_num_rows($izberiRed);

?>
<br />
<strong>Izberi red to&#269;k, ki ga &#382;eli&scaron; izvoziti iz baze.</strong>
<br />
<form action="extract_gKML.php" method="post" enctype="multipart/form-data">
  <label>
  <input name="selectProjekt" type="hidden" class="small-font" value="<?php echo $izbrani_projekt; ?>" size="8" tabindex="0" />
  <br />
  Red:
  <select name="selectRed" class="small-font" tabindex="1">
    <?php
do {  
?>
    <option value="<?php echo $row_izberiRed['stReda']?>"><?php echo $row_izberiRed['stReda']?></option>
    <?php
} while ($row_izberiRed = mysql_fetch_assoc($izberiRed));
  $rows = mysql_num_rows($izberiRed);
  if($rows > 0) {
      mysql_data_seek($izberiRed, 0);
	  $row_izberiRed = mysql_fetch_assoc($izberiRed);
  }
?>
  </select>
  <br />
  </label>
  <label>
  <input name="Submit" type="submit" class="small-font" tabindex="1" value="Pripravi KML" />
  </label>
</form>
<br />
<a href="prepare_xml.php">&lt;&lt; Nazaj na izbiro projekta</a><br />
<a href="index.php">&lt;&lt;&lt; Nazaj na prvo stran</a> 
</body>
</html>
<?php
mysql_free_result($izberiRed);
?>
